Practice Set 6

We'll cover the following

Practice Set 6#

For the purpose of demonstrating analytic window functions, we added a new MoviesScreening table and added some columns to the existing Movies table. The relevant portion of the database relationship model is printed below.

widget

Connect to the terminal below by clicking in the widget. Once connected, the command line prompt will show up. Enter or copy and paste the command ./DataJek/Lessons/quiz2.sh and wait for the MySQL prompt to start-up.

Terminal 1
Terminal

Click to Connect...

Write and execute queries for the following questions:

  1. Find the top two movies of distributors who have more than one movie to their name.

    Expected Result:

Distributor Movie CollectionInMillion Rank
Paramount Pictures 1
Paramount Pictures 2
Warner Bros 1
Warner Bros 2
  1. Find the total, average, minimum and maximum of the production budget and revenue earned from the Movies table and append the summary data to the top of the table.

    Expected Result:

Name BudgetInMillions CollectionInMillions
Total
Average
Maximum
Minimum
Ocean’s Twelve
Mission Impossible
  1. Calculate the mean median and mode of the running time of movies.

    Expected Result:

Measure Value
Mean
Median
Mode
  1. Find the correlation between budget, collection and running time of movies and display the results as a table.

    Expected Result:

BudgetInMillions CollectionInMillions RunningTime
BudgetInMillions 1.00
CollectionInMillions 1.00
RunningTime 1.00
  1. Find the market share of top 3 distributors and aggregate the remaining distributors in a single row.

    Expected Result:

Distibtor TotalCollection
distributor 1 amount
distributor 2 amount
distributor 3 amount
All Others amount
Solution Practice Set 5
Solution Practice Set 6
Mark as Completed
Report an Issue